﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Kcadastro.uctrl
{
    public partial class login : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["IDuser"] != null)
            {
                if (Session["IDuser"].ToString() != "")
                {
                    pn_deslogado.Visible = false;
                }
                else
                {
                    pn_deslogado.Visible = true;
                }
            }
            else
            {
                pn_deslogado.Visible = true;
            }
        }

        protected void bt_entrar_Click(object sender, EventArgs e)
        {
            classes.usuarios users = new classes.usuarios();
            if (users.logar(tblogin_email.Text, tblogin_senha.Text))
            {
                Response.Redirect("~/inicio.aspx");
            }
        }
    }
}